<!-- 数组方法 -->
<template>
  <div>
    {{ a }}
  </div>
</template>
<script setup>
const arr = [1, [2, [3]]];
const flattened = arr.flat(2); // 降维2层
console.log(flattened); // [1, 2, 3]
const flattened1 = arr.flat(Infinity); // 降维无限层
console.log(flattened1); // [1, 2, 3]
const flattened2 = arr.flat(); // 降维1层
console.log(flattened2); // [1, 2, [3]]
</script>